package com.itheima.sparkml.statices

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SparkSession

object _2randomNumber {
  def main(args: Array[String]): Unit = {
    val spark: SparkSession = SparkSession.builder().appName("_7DistributeMatrixRowMatrix").master("local[*]").getOrCreate()
    val sc = spark.sparkContext
    sc.setLogLevel("WARN")
    val data: RDD[Int] = sc.parallelize(Array(1, 2, 3, 4, 5, 6, 7, 8, 9))
    val ints = data.takeSample(false,5,123L)
    data.foreach(print(_))
    println()
    ints.foreach(println)

  }
}
